﻿namespace Finder.Utilities.KeyCapture
{
    /// <summary>
    /// Blalal blalas s as.
    /// </summary>
    public class KeyIdentifier
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="KeyIdentifier"/> class.
        /// </summary>
        /// <param name="keyCode">The key code.</param>
        /// <param name="keyName">Name of the key.</param>
        public KeyIdentifier(int keyCode, string keyName)
        {
            this.KeyCode = keyCode;
            this.KeyName = keyName;
        }

        /// <summary>
        /// Gets or sets the key code.
        /// </summary>
        /// <value>The key code.</value>
        public int KeyCode { get; set; }

        /// <summary>
        /// Gets or sets the name of the key.
        /// </summary>
        /// <value>The name of the key.</value>
        public string KeyName { get; set; }

        // override object.Equals

        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public override bool Equals(object obj)
        {
            if (obj is KeyIdentifier)
            {
                var q = (KeyIdentifier)obj;

                return q.KeyCode == this.KeyCode;
            }

            return false;
        }
    }
}